<template>
  <view class="feedback">
    <view class="textarea-box">
      <up-textarea
        v-model="opinion"
        placeholder="请输入您想要反馈的问题(5-500字以内)"
        height="500"
        maxlength="500"
        count
      ></up-textarea>
    </view>

    <view class="room-btn">
      <button class="btn" form-type="submit" @click="addFeedbackMessage" >提交</button>
    </view>
  </view>
</template>

<script setup>
import { addFeedbackMessageApi } from "@/package_property/pages/api/life-services.js"
import { ref } from "vue";

const opinion = ref("");
async function addFeedbackMessage() {
  const res = await addFeedbackMessageApi(opinion.value);
  const { code,data } =res||{};
  if (code ==200) {
    await uni.showToast({
        title: "提交成功",
        duration: 2000,
        success: () => {
          opinion.value = "";
        },
      });
  }
}
</script>

<style lang="less" scoped>
.textarea-box {
  width: 95vw;
  margin: 0 auto;
  :deep(.u-textarea) {
    background-color: #EEF1F5;
    height: auto;
    border-radius: 33rpx;
    border: 0;
    .u-textarea__count {
      background-color: transparent !important;
    }
  }
}
</style>